package org.lalib.controller.form;

import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.SessionScoped;
import javax.faces.model.SelectItem;

import org.lalib.acquire.IControllerForm;
import org.lalib.entity.object.EUser;
import org.lalib.entity.object.EUserGroup;
import org.springframework.stereotype.Controller;

@SessionScoped
@Controller(value = "cUserForm")
public class CUserForm implements IControllerForm {

	private static final long serialVersionUID = 1L;
	private Long selectedUserGroupId;
	private List<SelectItem> userGroupSelectItemList;
	private List<EUserGroup> userGroupList;
	private EUser user = new EUser();
	private List<EUser> users = new ArrayList<>();

	public void clear() {
		selectedUserGroupId = null;
		user = new EUser();
	}

	public List<EUserGroup> getUserGroupList() {
		return userGroupList;
	}

	public void setUserGroupList(List<EUserGroup> userGroupList) {
		this.userGroupList = userGroupList;
	}

	public List<SelectItem> getUserGroupSelectItemList() {
		return userGroupSelectItemList;
	}

	public void setUserGroupSelectItemList(List<SelectItem> userGroupSelectItemList) {
		this.userGroupSelectItemList = userGroupSelectItemList;
	}

	public Long getSelectedUserGroupId() {
		return selectedUserGroupId;
	}

	public void setSelectedUserGroupId(Long selectedUserGroupId) {
		this.selectedUserGroupId = selectedUserGroupId;
	}

	public EUser getUser() {
		return user;
	}

	public void setUser(EUser user) {
		this.user = user;
	}

	public List<EUser> getUsers() {
		return users;
	}

	public void setUsers(List<EUser> users) {
		this.users = users;
	}
}